﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMHetCaDAO
    {
        public bool m_Insert(DMHetCaDTO _info)
        {
            int istop = 0;
            if (_info.BbNgungSuDung == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMHetCa_Insert  N'{0}',{1}",_info.STenHetCa, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMHetCaDTO _info)
        {
            int istop = 0;
            if (_info.BbNgungSuDung == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMHetCa_Update {0},N'{1}',{2}", _info.IIDHetCa, _info.STenHetCa, istop);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMHetCaDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMHetCa_Delete {0}", _info.IIDHetCa);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMHetCa()
        {
            string _sql = string.Format("usp_ThuNgan_DMHetCa_SelectAll ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

        //Reflect to Frm_XacNhanHetCa---------------
        public DataTable m_SelectHetCa()
        {
            string _sql = string.Format("usp_ThuNgan_DMHetCa_SelectHC ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }
}
